package com.jiaertangshi.jiaer.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jiaertangshi.jiaer.dto.Adv;
import com.jiaertangshi.jiaer.service.AdvService;

/**
 * @ClassName: AdvController
 * @Description: AdvController
 * @author zfy
 * @date 2019年1月14日
 *
 */
@RequestMapping("/adv")
@RestController
public class AdvController {
	
	
	@Autowired
	AdvService  advService;
	
	
	/*
	 * 根据广告的显示位置获取广告
	 * location 显示位置  如 weixinhead
	 */
	@RequestMapping(value = "/advLocation", method = RequestMethod.GET)
    public List<Adv> getAdvsByLocation(@RequestParam(value = "location", required = true) String location) {
        return advService.getAdvsByLocation(location);
    }

}
